package com.envoy.testsuite.mvc;

import java.awt.event.ActionListener;
import java.util.EnumMap;

/**
 * The views provide and take information for the user without being exposed
 * to the actual logic of the underlying program.
 * @author Angus
 *
 */
public interface View {

  /**
   * Runs the view.
   */
  void run();

  /**
   * Attaches given listeners to the appropriate components.
   * @param listeners the listeners to attach.
   */
  void attachListeners(ActionListener[] listeners);

  /**
   * Gets a list of parameters to be passed on to the model.
   * @param operationType the type of operation the data is needed for.
   * @return the list of parameters.
   */
  EnumMap<Parameter, String> getParameters(
      OperationType operationType);

  /**
   * Updates the view with information from the model.
   * @param updateData the data required to update the view.
   * @return the result of the update.
   */
  int update(ModelTransferObject<ViewKey, UpdateType> updateData);

}
